package com.md.youyouhui.net.repo;

import android.arch.lifecycle.LiveData;

import com.md.youyouhui.common.Resource;
import com.md.youyouhui.net.ApiServiceFac;
import com.md.youyouhui.net.response.CodeResponse;
import com.md.youyouhui.utils.calladapter.ResourceConvertUtils;

/**
 * Created by AdministratorZJ
 * on 2018/5/25.
 */

public class CodeRepo {
    private static CodeRepo INSTANCE;

    public static CodeRepo newInstance() {
        if (null == INSTANCE) {
            INSTANCE = new CodeRepo();
        }
        return INSTANCE;
    }


    public LiveData<Resource<CodeResponse>> sendCode(String phone) {

        return ResourceConvertUtils.convertResource(ApiServiceFac.get().sendCode(phone));
    }

    public LiveData<Resource<CodeResponse>> sendCodeV2(String phone,String token ,String code) {

        return ResourceConvertUtils.convertResource(ApiServiceFac.get().sendCodeV2(phone,token,code));
    }


}
